#pragma once
#include <math.h>

#define __FIBONUM 1000
struct POINT2D{
	float x,y;	
	POINT2D(float xx = 0.f, float yy= 0.f)
	{
		x = xx;
		y = yy;
	}
	POINT2D operator + (const POINT2D q)
	{
		return POINT2D(x + q.x, y + q.y);
	}	
	POINT2D operator - (const POINT2D q)
	{
		return POINT2D(x - q.x, y - q.y);
	}
	POINT2D operator * (const float k)
	{
		return POINT2D(x*k, y*k);
	}
	float length()
	{
		return sqrt(x*x + y*y);
	}
	POINT2D normalize()
	{
		float l = this->length();
		return POINT2D(x / l, y / l);
	}

};

typedef struct{
	POINT2D p0, p1, p2;
	int id;				//current id;
	int fiboId;			//current Fibonaci id;
	int tileType;		//0(a), 1(b), 2(c), 3(d), 4(e), 5(f)
}TILE,*PTILE;

class PenroseTiling
{
	float FiboNumber[__FIBONUM];
public:
	PenroseTiling(void);
	~PenroseTiling(void);

	void Tiling(int w, int h, float ratio);
};
